﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Marmat.Common.Http.Token
{
    /// <summary>
    /// Token 的请求过滤器，用于将 token 值提交给服务器。
    /// </summary>
    public class TokenFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ApiActionContext context)
        {
            if (!string.IsNullOrEmpty(TokenConfiguration.Token))
                context.Request.Headers["token"] = TokenConfiguration.Token;
        }
    }


}
